Hook for managing a simple checkout modal
UseCheckoutModalReturnType
(settings: CheckoutSettings) => void
Opens the Checkout modal with the specified parameters.
Parameters:
The settings
object can include the following properties:
Property | Type | Description |
---|---|---|
creditCardCheckout | object | Settings for credit card checkout flow |
orderSummaryItems | array | Items to display in the order summary |
creditCardCheckout
object includes:
Parameter | Type | Description |
---|---|---|
chainId | number | The blockchain network ID |
contractAddress | string | The address of the contract to interact with |
recipientAddress | string | The address to receive the purchased item |
currencyQuantity | string | The quantity of currency to use for payment |
currencySymbol | string | The symbol of the currency (e.g., ‘USDC’) |
currencyAddress | string | The address of the currency token contract |
currencyDecimals | string | The number of decimals for the currency |
nftId | string | The ID of the NFT being purchased |
nftAddress | string | The address of the NFT contract |
nftQuantity | string | The quantity of NFTs to purchase |
approvedSpenderAddress | string | The address allowed to spend tokens |
calldata | string | The encoded function call data for the transaction |
onSuccess | (txHash: string) => void | Callback when transaction succeeds |
orderSummaryItems
array contains objects with:
Parameter | Type | Description |
---|---|---|
title | string | The title of the item |
subtitle | string | The subtitle of the item |
imageUrl | string | URL of the item’s image |
() => void
Closes the Checkout modal.
CheckoutSettings | undefined
The current settings configuration for the Checkout modal.